package service

import (
	"blog/config"
	"blog/dao"
	"blog/models"
	"log"
)

func Writing() (writing models.WritingResponse) {
	writing.Title = config.Cfg.Viewer.Title
	writing.CdnURL = config.Cfg.System.CdnURL
	categorys, err := dao.GetAllCategory()
	if err != nil {
		log.Println(err)
		return
	}
	writing.Categorys = categorys
	return
}
